home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
010
/
seabatle.arc
/
SB.BAS
next >
Wrap
BASIC Source File
|
1987-02-11
|
20KB
|
653 lines
CLS
randomize timer
def seg = 0
PRINT TAB(33);"Seabattle"
PRINT TAB(20);"Creative Computing, Morristown, NJ"
PRINT:PRINT :PRINT
DIM A(20,20),D(9),B(9)
open "R",1,"score.dat",12
field #1, 2% as sc$
get 1,1
score% = cvi(sc$)
ships% = 0
INPUT "What is your name? ",N$
REM
PRINT
310 REM ***set up area
FOR I=1 TO 20
FOR J=1 TO 20
A(I,J)=0
NEXT J
NEXT I
REM ***Island
RESTORE 6300
FOR X=7 TO 13
FOR Y=7 TO 12
READ A(X,Y)
NEXT Y
NEXT X
REM *** sub
S1=10:S2=10
A(S1,S2)=2
REM*** enemy ships
S=INT(RND*16)+15
RESTORE 6090
FOR X=1 TO (INT(RND*4)+1)*2-1
READ D8,D9
NEXT X
FOR X=1 TO S
500 X1=INT(RND*20)+1
X2=INT(RND*20)+1
IF A(X1,X2)<>0 THEN 500
A(X1,X2)=3
NEXT X
PRINT "You must destroy";S;"enemy ships to win ";N$;"."
REM *** headquarters
570 S3=INT(RND*20)+1
S4=INT(RND*20)+1
IF A(S3,S4)<>0 THEN 570
A(S3,S4)=4
REM ***underwater mines
FOR X=1 TO INT(RND*8)+8
630 X1=INT(RND*20)+1
X2=INT(RND*20)+1
IF A(X1,X2)<>0 THEN 630
A(X1,X2)=5
NEXT X
REM *** sea monsters
FOR X=1 TO 4
700 X1=INT(RND*18)+1
X2=INT(RND*18)+1
IF A(X1,X2)<>0 THEN 700
A(X1,X2)=6
RESTORE 6090
FOR Y=1 TO INT(RND*8)+1
READ M1,M2
NEXT Y
NEXT X
REM *** set starting values
FOR I=1 TO 9
D(I)=0
NEXT I
C=30
P=6000
F=2500
T=10
M=3
D=100
D2=2
880 REM ***command section
color 9,0
PRINT:PRINT:PRINT "What are your orders, Captain ";N$;
INPUT Order$:if order$="" then order$="0"
o = instr("NSTPMDHXCQWnstpmdhxcqw",order$)
if o>11 then o=o-11
ON O GOTO 1040,1680,2220,2680,3250,3410,3700,3880,4400,4660,4690
PRINT "The commands are:"
PRINT " N: Navigation"
PRINT " S: Sonar"
PRINT " T: Torpedo control"
PRINT " P: Polaris missile control"
PRINT " M: Manuevering"
PRINT " D: Status/damage report"
PRINT " H: Headquarters"
PRINT " X: Sabotage"
PRINT " C: Power conversion"
PRINT " Q: Surrender"
PRINT " W: Do nothing"
GOTO 880
1040 REM ***navigation
IF D(1)>=0 THEN 1080
PRINT "Engineering to Captain ";N$;", our engines are under repair!"
GOTO 880
1080 IF C>8 THEN 1110
PRINT "Not enough crew to man the engines, Captain ";N$;"!"
GOTO 880
1110 D1 = 1-((.23+RND/10)*(-(D<=50)))
GOSUB 6080
PRINT "Power available=";P;". Power to use";
INPUT P1
IF P1<0 OR P1>P THEN 880
IF P1<= 1000 THEN 1210
IF RND<.43 THEN 1210
PRINT "Atomic pile goes supercritical, Captain ";N$;"!!! Headquarters"
PRINT "will warn all subs to stay away from the radioactive area."
GOTO 6180
1210 X=S1
Y=S2
Q1=1
FOR X2 =1 TO INT(INT(P1/100+.5)*D1+.5)
IF X+X1>0 AND X+X1<21 AND Y+Y1>0 AND Y+Y1<21 THEN 1280
PRINT "You can't leave the area, Captain ";N$;"!!"
GOTO 1340
1280 ON A(X+X1,Y+Y1) + 1 GOTO 1290, 1330,1630,1390,1440,1470,1490
1290 X=X+X1
Y=Y+Y1
P=P-100
GOTO 1520
1330 PRINT "You almost ran aground, Captain ";N$;"!!"
1340 A(S1,S2)=0
A(X,Y)=2
S1=X
S2=Y
GOTO 4690
1390 IF D>50 THEN 1290
PRINT "You rammed a ship!!! You're both sunk, Captain ";N$;"!!"
S=S-1
ships% = ships% + 1
IF S=0 THEN 6260
GOTO 6180
1440 IF D>50 THEN 1290
PRINT "You rammed your own headquarters, you idiot! You've been sunk!"
GOTO 6180
1470 PRINT "You've been blown up by a mine, Captain ";N$;"!!"
GOTO 6180
1490 IF RND<.21 THEN 1630
1500 PRINT "You've been eaten by a sea monster, Captain ";N$;"!!"
GOTO 6180
1520 REM *** check for nearby sea monsters
FOR X3=X-2 TO X+2
FOR Y3 = Y-2 TO Y+2
IF X3<1 OR X3>20 OR Y3<1 OR Y3>20 THEN 1610
IF A(X3,Y3)<>6 THEN 1610
IF RND<.25 THEN 1500
IF Q1=0 THEN 1610
PRINT "You just had a narrow escape with a sea monster, Captain ";N$;"!!"
Q1=0
1610 NEXT Y3
NEXT X3
1630 NEXT X2
PRINT "Navigation complete. Power left=";P;"."
IF P>0 THEN 1340
1660 PRINT "Atomic pile has gone dead!!! Sub sinks, crew suffocates."
GOTO 6180
1680 REM ***#1 Sonar
IF D(2) >= 0 THEN 1720
PRINT "Sonar is under repair, Captain ";N$;"."
GOTO 880
1720 IF C>5 THEN 1750
PRINT "Not enough crew to work sonar, Captain ";N$;"."
GOTO 880
1750 PRINT "Option #";
INPUT O
ON INT(O+1) GOTO 1790,2010
GOTO 1750
1790 REM ***print out map
PRINT
FOR X=1 TO 20
FOR Y=1 TO 20
1830 DATA " ","***","(X)","\S/","!H!"," $ ","-#-"
IF A(X,Y)<>0 THEN 1880
goto 1880
1860 color 15,0: PRINT " . ";
GOTO 1950
1880 RESTORE 1830
FOR X1=1 TO A(X,Y)+1
READ A$
NEXT X1
x1 = x1 - 1
if x1=1 then color 1,1 else
if x1=2 then color 10,2 else
if x1=3 then color 4,1 else
if x1=4 then color 4,6 else
if x1=5 then color 6,1 else
if x1=6 then color 7,4 else
if x1=7 then color 2,1
IF D<50 AND RND<.23 AND A(X,Y)<>1 AND A(X,Y)<>2 THEN 1860
IF RND<.15 AND A(X,Y)>2 THEN 1860
PRINT A$;
1950 NEXT Y
color 0,0:PRINT
NEXT X
1980 P=P-50
IF P>0 THEN 880
GOTO 1660
2010 REM *** directional information
FOR I=1 TO 5
B(I)=0
NEXT I
PRINT "Direction # of Ships Distances"
RESTORE 6090
FOR X=1 TO 8
READ X1,Y1
X3 = 0
FOR X4 = 1 TO 20
IF S1+X1*X4<1 OR S1+X1*X4>20 OR S2+Y1*X4<1 OR S2+Y1*X4>20 THEN 2140
IF A(S1+X1*X4,S2+Y1*X4)<>3 THEN 2130
X3=X3+1
B(X3)=X4
2130 NEXT X4
2140 IF X3=0 THEN 2200
PRINT " ";X,X3,
FOR X4=1 TO X3
PRINT B(X4);
NEXT X4
PRINT
2200 NEXT X
GOTO 1980
2220 REM *** #2 Torpedo control
IF D(3) >= 0 THEN 2260
PRINT "Torpedo tubes are under repair, Captain ";N$;"."
GOTO 880
2260 IF C >= 10 THEN 2290
PRINT "Not enough crew to fire torpedo, Captain ";N$;"."
GOTO 880
2290 IF T THEN 2320
PRINT "No torpedoes left, Captain ";N$;"."
GOTO 880
2320 IF D<2000 THEN 2360
IF RND>.5 THEN 2360
PRINT "Pressure implodes sub upon firing...you're crushed!!"
GOTO 6180
2360 GOSUB 6080
X=S1
Y=S2
FOR X2=1 TO INT(7+5*(-(D>50))-RND*4+.5)
IF X+X1>0 AND X+X1<21 AND Y+Y1>0 AND Y+Y1<21 THEN 2460
PRINT "Torpedo out of sonar range...Ineffectual, Captain ";N$;"."
2420 T=T-1
P=P-150
2440 IF P>0 THEN 4690
GOTO 1660
2460 ON A(X+X1,Y+Y1)+1 GOTO 2470,2510,2650,2540,2580,2610,2630
2470 X=X+X1
Y=Y+Y1
PRINT "..!.."
GOTO 2650
2510 PRINT "You took out some island, Captain ";N$;"."
2520 A(X+X1,Y+Y1)=0
GOTO 2420
2540 PRINT "Ouch!!! You got one Captain ";N$;"!!"
S=S-1:ships% = ships% + 1
IF S<>0 THEN 2520
GOTO 6260
2580 PRINT "You blew up, your headquarters, you bumblebrain!"
S3=0: S4=0:D2=0
GOTO 2520
2610 PRINT "Blam!! Shot wasted on a mine, Captain ";N$;"."
GOTO 2520
2630 PRINT "You killed a poor, helpless sea monster, Captain ";N$;"."
GOTO 2520
2650 NEXT X2
PRINT "Dud."
GOTO 2420
2680 REM *** #3: Polaris Missile Control
IF D(4) >= 0 THEN 2720
PRINT "Missile silos are under repair, Captain ";N$;"."
GOTO 880
2720 IF C>23 THEN 2750
PRINT "Not enough crew to launch a missile, Captain ";N$;"."
GOTO 880
2750 IF M<>0 THEN 2780
PRINT "No missiles left, Captain ";N$;"."
GOTO 880
2780 IF D>50 AND D<2000 THEN 2850
PRINT "Recommend that you do not fire at this depth...Proceed";
INPUT A$
IF LEFT$(A$,1) ="n" OR LEFT$(A$,1) = "N" THEN 880
IF RND<.5 THEN 2850
PRINT "Missile explodes on firing, Captain ";N$;"! You're dead!"
GOTO 6180
2850 GOSUB 6080
2860 PRINT "Fuel (lbs.)";
INPUT F1
IF F1>0 AND F1 <= F THEN 2910
PRINT "You have";F;"lbs. of fuel left, Captain ";N$;"."
GOTO 2860
2910 F2 = INT (F1/75 +.5)
IF S1+X1*F2>0 AND S1+X1*F2<21 AND S2+Y1*F2>0 AND S2+Y1*F2<21 THEN 2980
PRINT "Missile out of sonar tracking, Captain ";N$;". Missile lost."
2940 M=M-1
F=F-F1
P=P-300
GOTO 2440
2980 D3=0: D4=0: D5 = 0: D6 =0
FOR X=S1+X1*F2 -1 TO S1+X1*F2 +1
FOR Y=S2+Y1*F2 -1 TO S2+Y1*F2 +1
IF X<1 OR X>20 OR Y<1 OR Y>20 THEN 3140
D3=D3-(A(X,Y)=3)
D4=D4-(A(X,Y)=6)
D5=D5-(A(X,Y)=5)
D6=D6-(A(X,Y)=1)
IF A(X,Y)<>4 THEN 3100
PRINT "You just destroyed your headquarters, Seaman 3rd class ";N$;"!"
D3=0:S4=0:D2=0
GOTO 3130
3100 IF A(X,Y)<>2 THEN 3130
PRINT "You just destroyed yourself, Captain ";N$;", you idiot!"
GOTO 6180
3130 A(X,Y)=0
3140 NEXT Y
NEXT X
IF D6=0 THEN 3180
PRINT "You blew out some island, Captain ";N$;"."
3180 IF D5=0 THEN 3200
PRINT "You destroyed";D5;"mines, Captain ";N$;"."
3200 IF D4=0 THEN 3220
PRINT "You got";D4;"sea monsters, Captain ";N$;". Good work!"
3220 PRINT "You destroyed";D3;"enemy ships, Captain ";N$;"."
S=S-D3:ships% = ships% + d3:if s = 0 then 6260
GOTO 2940
3250 REM ***maneuvering
IF D(5) >= 0 THEN 3290
PRINT "Ballast controls are being repaired, Captain ";N$;"."
GOTO 880
3290 IF C>12 THEN 3320
PRINT "There are not enough crew to work the controls, Captain ";N$;"."
GOTO 880
3320 PRINT "New depth;"
INPUT D1
IF D1 >= 0 AND D1<3000 THEN 3370
PRINT "Hull crushed by pressure, Captain ";N$;"!"
GOTO 6180
3370 P=P-INT(ABS((D-D1)/2+.5))
PRINT "Maneuver complete. Power loss ="INT(ABS((D-D1)/2+.5))
D=D1
GOTO 4690
3410 REM *** #5 status / damage report
IF D(6) >= 0 THEN 3450
PRINT "No reports are able to get through, Captain ";N$;"."
GOTO 880
3450 IF C>3 THEN 3480
PRINT "No one left to give the report, Captain ";N$;"."
GOTO 880
3480 PRINT "# of enemy ships left........";S
PRINT "# of power units left........";P
PRINT "# of torpedoes left..........";T
PRINT "# of missiles left...........";M
PRINT "lbs of fuel left.............";F
PRINT
PRINT "Want damage report";
INPUT A$
IF LEFT$(A$,1)="n" OR LEFT$(A$,1)="N" THEN 3670
PRINT " Item Damage (+ good, 0 Neutral, - Bad)"
PRINT " ---- ------"
3600 DATA "Engines","Sonar","Torpedos","Missiles","Maneuvering"
DATA "Status","Headquarters","Sabotage","Converter"
RESTORE 3600
FOR X=1 TO 9
READ A$
PRINT A$,D(X)
NEXT X
3670 PRINT "You are at location (";S1;",";S2;")."
PRINT
GOTO 880
3700 REM ***# 6 Headquarters
IF D(7)>=0 THEN 3740
PRINT "Headquarters is damaged. Unable to help, Captain ";N$;"."
GOTO 880
3740 IF D2<>0 THEN 3770
PRINT "Headquarters is deserted, Captain ";N$;"."
GOTO 880
3770 IF SQR((S1-S3)^2 + (S2-S4)^2) <=2 AND D<51 THEN 3800
PRINT "Unable to comply with docking orders, Captain ";N$;"."
GOTO 880
3800 PRINT "Divers from headquarters bring out supplies and men."
if p<4000 then P=4000
if t<8 then T=8
if m<2 then M=2
if f<1500 then F=1500
if c<25 then C=25
D2=D2-1
GOTO 4690
3880 REM *** #7 sabotage
IF D(8)>=0 THEN 3920
PRINT "Hatches inaccessible, Captain ";N$;". No sabotages possible."
GOTO 880
3920 IF C>10 THEN 3950
PRINT "Not enough crew to go on a mission, Captain ";N$;"."
GOTO 880
3950 D3=0:D4=0
FOR X=S1-2 TO S1+2
FOR Y=S2-2 TO S2+2
IF X<1 OR X>20 OR Y<1 OR Y>20 THEN 4010
D3=D3-(A(X,Y) = 3)
D4=D4-(A(X,Y) = 6)
4010 NEXT Y
NEXT X
IF D3<>0 THEN 4060
PRINT "No ships in range, Captain ";N$;"."
GOTO 880
4060 PRINT "There are";D3;"ships in range, Captain ";N$;"."
4070 PRINT "How many men are going, Captain ";N$;
4080 INPUT Q1
if q1 < 1 then print "You need at least 1 man, idiot!!":goto 4080
IF C-Q1 >= 10 THEN 4120
PRINT "You must leave at least 10 men on board, Captain ";N$;"."
GOTO 4070
4120 D5 = INT(D3/Q1 +.5)
D6=0
FOR X=S1-2 TO S1+2
FOR Y=S2-2 TO S2+2
IF D3/Q1>1-RND AND RND + D3/Q1<.9 THEN 4220
IF A(X,Y)<>3 THEN 4220
D6=D6+1
A(X,Y)=0
S=S-1:ships% = ships% + 1
IF S=0 THEN 6260
4220 NEXT Y
NEXT X
PRINT D6;"ships were destroyed, Captain ";N$;"."
D6=0:D7=0
FOR X=1 TO Q1
D7=D7-(RND>.6)
NEXT X
FOR X=1 TO Q1-D7
D6=D6-(RND<.15)
NEXT X
IF D4=0 THEN 4360
PRINT "A sea monster smells the men on the way back!!!"
PRINT D7;"Men were eaten, Captain ";N$;"!"
C=C-D7
4360 PRINT D6;"men were lost through accidents, Captain ";N$;"."
C=C-D6
P=P-INT(10*Q1+RND*10)
GOTO 4690
4400 REM *** #8 power conversion
IF D(9) >= 0 THEN 4440
PRINT "Power converter is damaged, Captain ";N$;"."
GOTO 880
4440 IF C>5 THEN 4470
PRINT "Not enough men to work the converter, Captain ";N$;"."
GOTO 880
4470 PRINT "Option? (1=Fuel to power, 2=Power to fuel)";
INPUT O
ON O GOTO 4510, 4580
GOTO 4470
4510 REM *** Fuel to power conversion
4520 PRINT "Fuel available=";F;". Convert";
INPUT C1
IF C1>F OR C1<0 THEN 4520
F=F-C1
P=P+INT(C1/3)
GOTO 4640
4580 REM ***power to fuel conversion
4590 PRINT "Power available="P-1;". Convert";
INPUT C1
IF C1>P-1 OR C1<0 THEN 4590
P=P-C1
F=F+INT(C1*3)
4640 PRINT "Conversion complete. Power=";P;". fuel=";F;"."
GOTO 4690
4660 REM *** #9 surrender
PRINT "Coward!!! You're not very patriotic, ex-Captain ";N$;"!"
GOTO 6180
4690 REM ***Retaliation section
Q=0
FOR X=S1-4 TO S1+4
FOR Y=S2-4 TO S2+4
IF X<1 OR X>20 OR Y<1 OR Y>20 THEN 4760
IF A(X,Y)<>3 THEN 4760
Q=Q+(RND/SQR((S1-X)^2+(S2-Y)^2))
4760 NEXT Y
NEXT X
IF Q THEN 4810
PRINT "No ships in range to depth charge you, Captain ";N$;"."
GOTO 5210
4810 PRINT "Depth charges off ";
IF RND>.5 THEN 4850
PRINT "port side, Captain ";N$;"!!!"
GOTO 4860
4850 PRINT "starboard side, Captain ";N$;"!!!"
4860 IF Q>.13 OR RND >92 THEN 4890
PRINT "No real damage sustained, Captain ";N$;"."
GOTO 5210
4890 IF Q>.36 OR RND>.96 THEN 4940
PRINT "Light, superficial damage, Captain ";N$;"."
P=P-50
D(INT(RND*9)+1)=-RND*2
GOTO 5210
4940 IF Q>.6 OR RND>.975 THEN 5020
PRINT "Moderate damage. Repairs needed."
P=P-75+INT(RND*30)
FOR Y=1 TO 2
X=INT(RND*9)+1
D(X)=D(X)-RND*8
NEXT Y
GOTO 5210
5020 IF Q>.9 OR RND>.983 THEN 5100
PRINT "Heavy damage!! Repairs immediate, Captain ";N$;"!!!"
5040 P=P-(200+INT(RND*76))
FOR X=1 TO 4+INT(RND*2)
Y=INT(RND*9)+1
D(Y)=D(Y)-RND*11
NEXT X
GOTO 5210
5100 PRINT "Damage critical !!!!! We need help!!!!"
A$="VRAVUKXCNVPCRHFDRSAXQURLQTRHXYACVFZYITLCBSSYYKDQIPCAEGQGPCNOTSIO"
X=INT(RND*64)+1
test = peek(1047):poke 1047, test or 64
PRINT "Send 'HELP'in code. Here is the code:";MID$(A$,X,4);
REM time delay and then erase the code
FOR I=1 TO 5000:NEXT I
for counter = 1 to 4:print chr$(29);" ";chr$(29);:next:print
INPUT "Enter code";B$
PRINT
poke 1047, test
IF B$<>MID$(A$,X,4) THEN 5190
PRINT "Fast work, Captain ";N$;"!! Help arrives in time to save you!!!"
GOTO 5040
5190 PRINT "Message garbled, Captain ";N$;"...No help arrives!!!"
GOTO 6180
5210 if p<0 then 1660
rem ***Move ships, sea monsters
IF D(1) >=0 OR D(3)>=0 OR D(4)>=0 OR D(5)>=0 OR D(7)>=0 THEN 5260
IF D(8) >=0 OR D(9)>=0 THEN 5260
PRINT "Damage too much, Captain ";N$;"!! You're sunk!!!"
GOTO 6180
5260 REM ***move ships/sea monsters
PRINT:PRINT:PRINT "---***Result of Last Enemy Manuever ***---"
FOR X=1 TO 20
FOR Y=1 TO 20
tries = 0
IF A(X,Y)<>3 THEN 5690
REM **move a ship
W=D8
V=D9
IF X+W>0 AND X+W<21 AND Y+V>0 AND Y+V<21 THEN 5420
FOR X0=19 TO 1 STEP -1
IF A(X-W*X0,Y-V*X0)<>0 THEN 5400
A(X-W*X0,Y-V*X0)=3
A(X,Y)=0
GOTO 6000
5400 NEXT X0
goto 6320
5420 ON A(X+W,Y+V)+1 GOTO 5430,5460,5530, 5460,5560,5600,5650
5430 A(X+W,Y+V)=3
5440 A(X,Y)=0
GOTO 6000
5460 REM ***change direction
5470 RESTORE 6090
FOR X0=1 TO INT(RND*8)+1
READ W,V
NEXT X0
tries = tries + 1: if tries > 30 goto 6000
IF X+W<1 OR X+W>20 OR Y+V<1 OR Y+V>20 THEN 5470
GOTO 5420
5530 IF D>50 THEN 5460
PRINT "*** You've been rammed by a ship, Captain ";N$;"!!!"
GOTO 6180
5560 IF RND<.15 THEN 5460
PRINT "*** Your headquarters was rammed, Captain ";N$;"!!!"
S3=0:S4=0:D2=0:A(X+W,Y+V)=0
GOTO 5620
5600 IF RND<.7 THEN 5460
PRINT "*** Ship destroyed by a mine, Captain ";N$;"!!!"
5620 S=S-1
5630 IF S<>0 THEN 5440
GOTO 6260
5650 IF RND<.9 THEN 5460
PRINT "*** Ship eaten by a sea monster, Captain ";N$;"!!!"
S=S-1
GOTO 5630
5690 REM *** Move a sea monster
IF A(X,Y)<>6 THEN 6000
IF X+M1<1 OR X+M1>20 OR Y+M2<1 OR Y+M2>20 THEN 5760
5720 ON A(X+M1,Y+M2)+1 GOTO 5730,5760,5830,5850,5900,5725,5930
5725 print "*** A sea monster ate a mine (urp!), Captain ";N$;"!!"
5730 A(X+M1,Y+M2) = 6
A(X,Y) = 0
GOTO 6000
5760 REM *** change direction
RESTORE 6090
FOR X0 = 1 TO INT(RND*8)+1
READ M1,M2
NEXT X0
IF X+M1<1 OR X+M1>20 OR Y+M2<1 OR Y+M2>20 THEN 5760
GOTO 5720
5830 PRINT "*** You've been eaten by a sea monster, Captain ";N$;"!!!"
GOTO 6180
5850 IF RND>.2 THEN 5760
PRINT "*** Ship eaten by a sea monster, Captain ";N$;"!!!"
S=S-1
IF S<>0 THEN 5730
GOTO 6260
5900 PRINT "*** A sea monster ate your headquarters, Captain ";N$;"!!!"
S3=0:S4=0:D2=0
GOTO 5730
5930 IF RND<.75 THEN 5760
PRINT "*** A sea monster fight, Captain ";N$;"!!!";
IF RND<.8 THEN 5980
PRINT " And one dies!!!"
GOTO 5730
5980 PRINT " It's a tie!!!"
GOTO 5760
6000 NEXT Y
NEXT X
REM *** make repairs
FOR Y=1 TO 9
X=INT(RND*9)+1
D(X)=D(X)+(RND*(2+RND*2))*(1+(-(D<51) OR -(D>2000)))*(-(D(X)<3))
NEXT Y
GOTO 880
6080 REM *** gosub for course / direction ***
6090 DATA -1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1,-1,-1
6100 PRINT "Course (1-8)";
INPUT C1
IF C1<1 OR C1>8 THEN 6100
RESTORE 6090
FOR X9=1 TO INT(C1+.5)
READ X1,Y1
NEXT X9
RETURN
6180 REM *** Destroyed?
if s = 0 then 6260
PRINT "There are still";S;"enemy ships left, Captain ";N$;"."
PRINT "You will be demoted to rank of deck scrubber!!!!!"
score% = score% - (s * 3)
6210 ships% = 0:PRINT "Score is: ";score%;" Want another game";
lset sc$ = mki$(score%)
put 1,1
INPUT A$
IF LEFT$(A$,1)<>"Y" AND LEFT$(A$,1)<>"y" THEN 6250
GOTO 310
6250 goto 6320
6260 PRINT "Good work, Admiral ";N$;"!!! You got them all!!!"
PRINT "Promotion and commendations are effective, immediately!!!"
score% = score% + ships%
GOTO 6210
REM *** island data
6300 DATA 0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,1
DATA 1,1,0,0,1,1,0,1,1,0,1,0,0,0,1,0,0,0
6320 close 1:color 15,1,1:cls:END